// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {
    AddSysLdapInput,
    DeleteSysLdapInput,
    SysLdapInput,
    SyncSysLdapInput,
    UpdateSysLdapInput,
} from '../models';
// 定义 API 路径枚举
enum Api {
    AddSysLdap = '/sysLdap/add',
    DeleteSysLdap = '/sysLdap/delete',
    DetailSysLdap = '/sysLdap/detail',
    ListSysLdap = '/sysLdap/list',
    PageSysLdap = '/sysLdap/page',
    SyncDeptSysLdap = '/sysLdap/syncDept',
    SyncUserSysLdap = '/sysLdap/syncUser',
    UpdateSysLdap = '/sysLdap/update',
}

// 增加系统域登录配置
export const apiSysLdapAddPost = (body: AddSysLdapInput) =>
    request({
        url: Api.AddSysLdap,
        method: 'post',
        data: body,
    });

// 删除系统域登录配置
export const apiSysLdapDeletePost = (body: DeleteSysLdapInput) =>
    request({
        url: Api.DeleteSysLdap,
        method: 'post',
        data: body,
    });

// 获取系统域登录配置详情
export const apiSysLdapDetailGet = (id: number) =>
    request({
        url: Api.DetailSysLdap,
        method: 'get',
        params: { Id: id },
    });

// 获取系统域登录配置列表
export const apiSysLdapListGet = () =>
    request({
        url: Api.ListSysLdap,
        method: 'get',
    });

// 获取系统域登录配置分页列表
export const apiSysLdapPagePost = (body: SysLdapInput) =>
    request({
        url: Api.PageSysLdap,
        method: 'post',
        data: body,
    });

// 同步域组织
export const apiSysLdapSyncDeptPost = (body: SyncSysLdapInput) =>
    request({
        url: Api.SyncDeptSysLdap,
        method: 'post',
        data: body,
    });

// 同步域用户
export const apiSysLdapSyncUserPost = (body: SyncSysLdapInput) =>
    request({
        url: Api.SyncUserSysLdap,
        method: 'post',
        data: body,
    });

// 更新系统域登录配置
export const apiSysLdapUpdatePost = (body: UpdateSysLdapInput) =>
    request({
        url: Api.UpdateSysLdap,
        method: 'post',
        data: body,
    });